﻿using System.Web;
using System.Web.Profile;

namespace Webbshop
{
    public class MyProfile : ProfileBase
    {
        public string FirstName
        {
            get { return (string)GetPropertyValue("FirstName"); }
            set { SetPropertyValue("FirstName", value); }
        }
        public string LastName
        {
            get { return (string)GetPropertyValue("LastName"); }
            set { SetPropertyValue("LastName", value); }
        }
        public string Street
        {
            get { return (string)GetPropertyValue("Street"); }
            set { SetPropertyValue("Street", value); }
        }
        public string PostalCode
        {
            get { return (string)GetPropertyValue("PostalCode"); }
            set { SetPropertyValue("PostalCode", value); }
        }
        public string PostalArea
        {
            get { return (string)GetPropertyValue("PostalArea"); }
            set { SetPropertyValue("PostalArea", value); }
        }
        public string Address
        {
            get { return (string)GetPropertyValue("Address"); }
            set { SetPropertyValue("Address", value); }
        }

        public Cart Basket
        {
            get { return (Cart)GetPropertyValue("Basket"); }
            set { SetPropertyValue("Basket", value); }
        }
        

        /// <summary>  
        /// Gets the profile of the current user  
        /// </summary>  
        /// <returns></returns>  
        public static MyProfile GetProfile()
        {
            return HttpContext.Current.Profile as MyProfile;
        }

        /// <summary>  
        /// Gets the profile of a specific user  
        /// </summary>  
        /// <param name="userName">User name of the profile to get</param>  
        /// <returns></returns>  
        public static MyProfile GetProfile(string userName)
        {
            return (MyProfile)Create(userName);
        }
    }  
}